home *** CD-ROM | disk | FTP | other *** search
/ Gekikoh Dennoh Club 5 / Gekikoh Dennoh Club Vol. 5 (Japan).7z / Gekikoh Dennoh Club Vol. 5 (Japan) (Track 01).bin / internet / webx / jpged26s.lzh / VtoYUV.S < prev    next >
Encoding:
Text File  |  1996-04-15  |  4.2 KB  |  246 lines

  1. *
  2. *
  3. *  VTOYUV.S
  4. *
  5. *  ùúÄUâRâTâCâôò╧è╖âeâXâgâvâìâOâëâÇ
  6. *
  7. *
  8. .include    work.inc
  9.  
  10.   .text
  11.  
  12.   xdef   VRAM_to_YUV,VRAM_to_YUV2,VRAM_to_YUV4
  13.  
  14. *
  15. *    VRAMâfü[â^é⌐éτRGBɼò¬é≡ò¬ùúé╖éΘâ}âNâì
  16. *
  17. VtoRGB    macro  Vin
  18.       move.w  Vin,d2
  19.       move.w  d2,d1
  20.       lsl.w   #5,d1
  21.       moveq.l #$0020,d0
  22.       and.w   d1,d0 * I
  23.       and.w   #$07e0,d1 * B
  24.       move.w  d2,d3
  25.       and.w   #$07c0,d3
  26.       or.w    d0,d3     * R
  27.       lsr.w   #5,d2
  28.       and.w   #$07c0,d2
  29.       or.w    d0,d2     * G
  30.     endm
  31.  
  32. *
  33. *    Yɼò¬îvÄZâ}âNâì
  34. *
  35. conv_y    macro    out
  36.       move.l  R02990(a4,d3.w),out
  37.       add.l   G05870(a4,d2.w),out
  38.       add.l   B01140(a4,d1.w),out
  39.     endm
  40. *
  41. *    Uɼò¬îvÄZâ}âNâì
  42. *
  43. conv_u    macro    out
  44.       move.l  R01684(a4,d3.w),out
  45.       add.l   G03316(a4,d2.w),out
  46.       add.l   R05000(a4,d1.w),out
  47.     endm
  48. *
  49. *    Uɼò¬îvÄZâ}âNâì2
  50. *
  51. conv_ua    macro    out
  52.       add.l   R01684(a4,d3.w),out
  53.       add.l   G03316(a4,d2.w),out
  54.       add.l   R05000(a4,d1.w),out
  55.     endm
  56. *
  57. *    Vɼò¬îvÄZâ}âNâì
  58. *
  59. conv_v    macro    out
  60.       move.l  R05000(a4,d3.w),out
  61.       add.l   G04187(a4,d2.w),out
  62.       add.l   B00813(a4,d1.w),out
  63.     endm
  64. *
  65. *    Vɼò¬îvÄZâ}âNâì2
  66. *
  67. conv_va    macro    out
  68.       add.l   R05000(a4,d3.w),out
  69.       add.l   G04187(a4,d2.w),out
  70.       add.l   B00813(a4,d1.w),out
  71.     endm
  72. *
  73. *  VRAM to YUV
  74. *    a0    VRAM(w)
  75. *    a1    Ydata(w)
  76. *    a2    Udata(w)
  77. *    a3    Vdata(w)
  78. *
  79. *
  80. VRAM_to_YUV
  81.   movea.l  a6,a4
  82.   adda.l   #RGB_YUV_TBL,a4
  83.   movea.l  HScroll_size(a6),a5
  84.   moveq.l  #8-1,d6
  85. ry10
  86.     moveq.l  #8-1,d7
  87. ry20
  88.       VtoRGB  (a0)+
  89.       conv_y  d0
  90.       move.l  d0,(a1)+  * Y
  91.  
  92.       conv_u  d0
  93.       move.l  d0,(a2)+  * U
  94.  
  95.       conv_v  d0
  96.       move.l  d0,(a3)+  * V
  97. *
  98.     dbra.w    d7,ry20
  99.   lea     -8*2(a0,a5.l),a0
  100.   dbra.w    d6,ry10
  101.   rts
  102. *
  103.  
  104.  
  105.  
  106.  
  107.  
  108. VRAM_to_YUV2
  109.   movea.l  a6,a4
  110.   adda.l   #RGB_YUV_TBL,a4
  111.   movea.l  HScroll_size(a6),a5
  112.   moveq.l  #8-1,d6
  113. ry210
  114.     moveq.l  #4-1,d7
  115. ry220
  116.       VtoRGB  (a0)+
  117.       conv_y  d0
  118.       move.l  d0,(a1)+  * Y
  119.       conv_u  d4
  120.       conv_v  d5
  121.  
  122.       VtoRGB  (a0)+
  123.       conv_y  d0
  124.       move.l  d0,(a1)+  * Y
  125.       conv_ua d4
  126.       conv_va d5
  127.  
  128.       asr.l   #1,d4
  129.       asr.l   #1,d5
  130.       move.l  d4,(a2)+  * U
  131.       move.l  d5,(a3)+  * V
  132. *
  133.     dbra.w    d7,ry220
  134.  
  135.     lea.l    (-8+8*8)*4(a1),a1
  136.     moveq.l  #4-1,d7
  137. ry230
  138.       VtoRGB  (a0)+
  139.       conv_y  d0
  140.       move.l  d0,(a1)+  * Y
  141.       conv_u  d4
  142.       conv_v  d5
  143.  
  144.       VtoRGB  (a0)+
  145.       conv_y  d0
  146.       move.l  d0,(a1)+  * Y
  147.       conv_ua d4
  148.       conv_va d5
  149.  
  150.       asr.l   #1,d4
  151.       asr.l   #1,d5
  152.       move.l  d4,(a2)+  * U
  153.       move.l  d5,(a3)+  * V
  154. *
  155.     dbra.w    d7,ry230
  156.  
  157.   lea.l   (-8-8*8+8)*4(a1),a1
  158.   lea     -8*2*2(a0,a5.l),a0
  159.   dbra.w    d6,ry210
  160.   rts
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167. VRAM_to_YUV4
  168.   movea.l  a6,a4
  169.   adda.l   #RGB_YUV_TBL,a4
  170.   movea.l  HScroll_size(a6),a5
  171.   moveq.l  #4-1,d6
  172. ry410
  173.     moveq.l  #4-1,d7
  174. ry420
  175.       VtoRGB  (a0)+
  176.       conv_y  d0
  177.       move.l  d0,(a1)+  * Y
  178.       conv_u  d4
  179.       conv_v  d5
  180.  
  181.       VtoRGB  (a0)+
  182.       conv_y  d0
  183.       move.l  d0,(a1)+  * Y
  184.       conv_ua  d4
  185.       conv_va  d5
  186.  
  187.       VtoRGB  -4(a0,a5.l)
  188.       conv_y  d0
  189.       move.l  d0,(-2+1*8)*4(a1)  * Y
  190.       conv_ua  d4
  191.       conv_va  d5
  192.  
  193.       VtoRGB  -2(a0,a5.l)
  194.       conv_y  d0
  195.       move.l  d0,(-1+1*8)*4(a1)  * Y
  196.       conv_ua  d4
  197.       conv_va  d5
  198.  
  199.       asr.l   #2,d4
  200.       asr.l   #2,d5
  201.       move.l  d4,(a2)+  * U
  202.       move.l  d5,(a3)+  * V
  203. *
  204.     dbra.w    d7,ry420
  205.  
  206.     lea.l    (-8+8*8)*4(a1),a1
  207.     moveq.l  #4-1,d7
  208. ry430
  209.       VtoRGB  (a0)+
  210.       conv_y  d0
  211.       move.l  d0,(a1)+  * Y
  212.       conv_u  d4
  213.       conv_v  d5
  214.  
  215.       VtoRGB  (a0)+
  216.       conv_y  d0
  217.       move.l  d0,(a1)+  * Y
  218.       conv_ua  d4
  219.       conv_va  d5
  220.  
  221.       VtoRGB  -4(a0,a5.l)
  222.       conv_y  d0
  223.       move.l  d0,(-2+1*8)*4(a1)  * Y
  224.       conv_ua  d4
  225.       conv_va  d5
  226.  
  227.       VtoRGB  -2(a0,a5.l)
  228.       conv_y  d0
  229.       move.l  d0,(-1+1*8)*4(a1)  * Y
  230.       conv_ua  d4
  231.       conv_va  d5
  232.  
  233.       asr.l   #2,d4
  234.       asr.l   #2,d5
  235.       move.l  d4,(a2)+  * U
  236.       move.l  d5,(a3)+  * V
  237. *
  238.     dbra.w    d7,ry430
  239.  
  240.   lea.l   (-8-8*8+8*2)*4(a1),a1
  241.   lea.l   -8*2*2(a0,a5.l),a0
  242.   adda.l  a5,a0
  243.   dbra.w    d6,ry410
  244.   rts
  245.   .end
  246.